<?php

// Edit these configuration items below to suit your requirements

// Do you want email notification when a user encounters an error page?
$mail_me_on_error = 0;                     // 1 = yes, 0 = no
$my_email = "getchandanc@gmail.com";       // replace with your email address

// The home address of your website, so we can redirect users after an error
$homepage = "http://localhost/Repo/mypicsonline";

// You may edit the entries below, or add extra ones in similar format
$errortext["400"] = "<h3>Bad Request.</h3>The request could not be understood by the server due to malformed syntax.<br>";
$errortext["401"] = "<h3>You don't have authority to view this page.</h3>Please contact your __techSoft if you think you should be allowed access here.<br>";
$errortext["403"] = "<h3>Action Forbidden.</h3>The server understood your request but cannot process it.<br>";
$errortext["404"] = "<h3>The page you requested was not found.</h3>
You may have typed the URL incorrectly, or the page may have been renamed or removed.<br>";
$errortext["500"] = "<h3>The server has suffered an internal error.</h3>
This may be a bug, Thanks for reporting a bug, Our engineers will resolve soon. Please try again later.<br>";


/***********************************************************
* Don't edit below this line:                              *
***********************************************************/

// get the error number passed in the URL
$errorcode = $_GET["code"];  

// get the relevant error code:
if(array_key_exists($errorcode,$errortext))
{
  $output = $errortext[$errorcode];
} else {
  $output = "An unspecified error has occurred.<br>";
}

// if email notofication is configured, send it, and tell the user it has been sent:
if($mail_me_on_error == 1)
{
  $output .= "The error has been reported to the site administrator.<br>";
  $body = "A user has received error ".$errorcode." while trying to access a page.";
  mail($my_email,"Server Error on ".$homepage,$body);
}

// give the user a link to get them back on track:
$output .= "To return to the homepage, click <a href='$homepage'>HERE</a>";

// The code below forms the HTML template for the error page.  Edit the HTML 
// to fit in with your site, but leave the PHP sections as they are.
?>
<html>
<head>
</head>
<body>
<?php 
  echo $output; 
?>
</body>
</html>
